package com.xinqi.modules.sys.dict.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xinqi.common.core.constant.UserConstants;
import com.xinqi.common.mybatis.data.repo.SuperMapper;
import com.xinqi.modules.sys.dict.domain.SysDictDataEntity;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 字典表 数据层
 *
 * @author dgyu
 */
@Mapper
public interface SysDictDataMapper extends SuperMapper<SysDictDataEntity> {

    default List<SysDictDataEntity> selectDictDataByType(String dictType) {
        return selectList(new LambdaQueryWrapper<SysDictDataEntity>().eq(SysDictDataEntity::getStatus, UserConstants.DICT_NORMAL).eq(SysDictDataEntity::getDictType, dictType).orderByAsc(SysDictDataEntity::getDictSort));
    }

}
